-
Notifications
You must be signed in to change notification settings - Fork 33
Feat/add rt support #1266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/add rt support #1266
Conversation
| isValid: true, | ||
| }, | ||
| { | ||
| description: "routing-table id invalid", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the routing-table-id flag is optional, could we please have a test case without the flag being set or being invalid?
| ipv6DnsNameServersFlag: "2001:4860:4860::8888,2001:4860:4860::8844", | ||
| ipv6GatewayFlag: "2001:4860:4860::8888", | ||
| labelFlag: "key=value", | ||
| routingTableIdFlag: testRoutingTableId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, routing table id flag is optional to there must be at least 1 test case IMO which doesn't have it set
| } | ||
|
|
||
| func outputResult(p *print.Printer, outputFormat string, routingTable *iaas.RoutingTable) error { | ||
| if routingTable == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition can be moved into the callback func for the pretty output, so the JSON/YAML output is the actual API response
| return fmt.Errorf("create routing-table response is empty") | ||
| } | ||
|
|
||
| if routingTable.Id == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
| } | ||
|
|
||
| func outputResult(p *print.Printer, outputFormat, routingTableId, networkAreaId string, route *iaas.Route) error { | ||
| if route == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check can be removed, is already present in the pretty output callback func
| return fmt.Errorf("update route response is empty") | ||
| } | ||
|
|
||
| if route.Id == nil || *route.Id == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check can be removed, is already present in the pretty output callback func
| return fmt.Errorf("update routing-table response is empty") | ||
| } | ||
|
|
||
| if routingTable.Id == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check belongs into pretty output callback func, JSON/YAML output won't have problems with this being nil
Description
reopened #1023
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)